package org.lsy.tlais.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.lsy.tlais.pojo.Emp;
import org.lsy.tlais.pojo.EmpPrame;
import org.lsy.tlais.pojo.PageResult;

import java.util.List;

@Mapper
public interface EmpMapping {

    // 分页查询-使用MyBatis提供的分页插件 + 动态SQL优化
    public Page<Emp> list(EmpPrame empPrame);

    // 新增员工基本信息
    @Options(useGeneratedKeys = true, keyProperty = "id")//主键返回
    @Insert("insert into emp(username, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time) " +
            "VALUES (#{username}, #{name}, #{gender}, #{phone}, #{job}, #{salary}, #{image}, #{entryDate}, #{deptId}, #{createTime}, #{updateTime})")
    void insert(Emp emp);

    //
}
